Dim wsh, fso
Set wsh = Wscript.CreateObject("Wscript.Shell") 
Set fso = CreateObject("Scripting.FileSystemObject")

'sFolder = wsh.SpecialFolders("AllUsersStartMenu")

StartFolder =wsh.ExpandEnvironmentStrings("%appdata%")& "\Microsoft\Windows\Start Menu\SkypeTranslater\"
userprofile = wsh.ExpandEnvironmentStrings("%USERPROFILE%")
installedPath = readFromRegistry("HKCU\Software\SkypeTranslator\ProgramPath","")

function readFromRegistry (strRegistryKey, strDefault )
    Dim WSHShell, value

    On Error Resume Next
    Set WSHShell = CreateObject("WScript.Shell")
    value = WSHShell.RegRead( strRegistryKey )

    if err.number <> 0 then
        readFromRegistry= strDefault
    else
        readFromRegistry=value
    end if
    set WSHShell = nothing
end function

if fso.FolderExists(installedPath) = true then

if fso.FolderExists(userprofile) = true then
Set oShellLink = wsh.CreateShortcut(userprofile & "\Desktop\SkypeTranslator.lnk") 
oShellLink.TargetPath = installedPath & "\SkypeTranslater.exe" 
' We need to copy the icon locally for the shortcut
oShellLink.IconLocation = installedPath & "\Notepad.ico" 
oShellLink.Save 
Set oShellLink = nothing
end if

if fso.FolderExists(StartFolder) = true then
Set oShellLink = wsh.CreateShortcut(StartFolder & "\SkypeTranslator.lnk") 
oShellLink.TargetPath = installedPath & "\SkypeTranslater.exe" 
' We need to copy the icon locally for the shortcut
oShellLink.IconLocation = installedPath & "\Notepad.ico" 
oShellLink.Save 
Set oShellLink = nothing
end if

end if

Set fso = nothing
Set wsh = nothing
